package org.dennisit.elastic.process;

import org.elasticsearch.action.search.SearchResponse;

public class TestES {

	public static void main(String[] args) {
		ESClient client = new ESClient();
		client.init();
//		client.addTime();//添加时间类型数据
//		client.searchTime();//测试取出时间数据
//		client.createIndex();//创建索引
//		client.search();//精确查询
//		client.search4();//短语查询
//		client.search2();//范围查询
//		client.search3();//模糊查询
//		client.search5();//模糊查询2
//		client.deleteIndex("AVWe3tXI10OOTlTBsIxW");//删除指定id的数据
//		client.getIndexById("AVWe3tXl10OOTlTBsIxf");//查询某个索引
		SearchResponse result = client.searcher("id", "desc", 2, 10);//分页查询
		long count = client.countQuery();//统计总数
		System.out.println("result ==> "+result);
		System.out.println("count ==> "+count);
		client.close();
	}

}
